package com.artifact.mit.mypoint.fragment.app;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.artifact.mit.mypoint.adapter.SourceSummaryAdapter;
import com.artifact.mit.mypoint.service.model.SourceSummary;
import com.artifact.mit.mypoint.R;

public class SourceSummaryFragment extends Fragment {

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		return inflater.inflate(R.layout.source_summary, null);
	}

	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);

		ListView sourceSummary = (ListView) getView().findViewById(
				R.id.listView2);
		SourceSummaryAdapter adapter = new SourceSummaryAdapter(getActivity());
		adapter.add(new SourceSummary("GFF", "9.990", "9.990"));
		adapter.add(new SourceSummary("Ace Hardware", "32.500", "32.500"));
		adapter.add(new SourceSummary("Margo City", "5.000", "5.000"));
		adapter.add(new SourceSummary("Living World", "100.000", "50.000"));
		adapter.add(new SourceSummary("Blibli", "50.000", "25.000"));
		adapter.add(new SourceSummary("KidZania", "30.000", "10.000"));
		sourceSummary.setAdapter(adapter);
	}

}
